package benchmark;

import java.util.Arrays;

import utils.ArgumentParsingException;
import utils.Tools;
import utils.Tools.OutputType;


public class WalkthoughArray extends AbstractBenchmarkST {

	private final static String ARRAY_SIZE = "arraysize";
	
	long[] data;
	
	public WalkthoughArray(String[] args) throws Exception {
		super(args);
		this.argReadme.put(ARRAY_SIZE, "Array size.");
		
		data = Tools.newMem(getArg(ARRAY_SIZE));
		
	}
	

	@Override
	protected long compute() {
		long sum = 0;
		for (int i = 0; i < data.length; i++) {
			sum += data[i];
		}
		return sum;
	}

	/**
	 * @param args
	 * @throws ArgumentParsingException 
	 */
	public static void main(String[] args) throws Exception {
		Tools.output(Arrays.toString(args), OutputType.DEBUG);
		WalkthoughArray b = new WalkthoughArray(args);
		b.run();
	}

}
